/**
 * Copyright 2014  XCL-Charts
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @Project XCL-Charts
 * @Description Android图表基类库演示
 * @author XiongChuanLiang<br></br>(xcl_168@aliyun.com)
 * @license http://www.apache.org/licenses/  Apache v2 License
 * @version 1.7
 */
package com.demo.xclcharts.view1

import android.content.Context
import android.util.AttributeSet
import com.gitee.wsl.common.chart.ChartView
import org.xclcharts.common.DensityUtil


/**
 * @ClassName DemoView
 * @Description  各个例子view的view基类
 * @author XiongChuanLiang<br></br>(xcl_168@aliyun.com)
 */
open class DemoView : ChartView {
    constructor(context: Context) : super(context) {        // TODO Auto-generated constructor stub
    }

    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {}
    constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(
        context,
        attrs,
        defStyle
    ) {
    }//left	

    //top	
    //right	
    //bottom						
    //Demo中bar chart所使用的默认偏移值。
    //偏移出来的空间用于显示tick,axistitle....
    protected open val barLnDefaultSpadding: IntArray
        protected get() {
            val ltrb = IntArray(4)
            ltrb[0] = DensityUtil.dip2px(context, 0f) //left
            ltrb[1] = DensityUtil.dip2px(context, 0f) //top
            ltrb[2] = DensityUtil.dip2px(context, 0f) //right
            ltrb[3] = DensityUtil.dip2px(context, 0f) //bottom
            return ltrb
        }

    //left	
    //top	
    //right		
    //bottom						
    protected val pieDefaultSpadding: IntArray
        protected get() {
            val ltrb = IntArray(4)
            ltrb[0] = DensityUtil.dip2px(context, 0f) //left
            ltrb[1] = DensityUtil.dip2px(context, 0f) //top
            ltrb[2] = DensityUtil.dip2px(context, 0f) //right
            ltrb[3] = DensityUtil.dip2px(context, 0f) //bottom
            return ltrb
        }

}